5402: Align nginx image env-var contract#412
Merged
turegjorup merged 5 commits intoApr 29, 2026
Merged
Conversation
Finalize the nginx image's operator-facing env-var surface so the
compose side has a single name per concept:
NGINX_FPM_SERVICE=os2display (host only — was host:port combined)
NGINX_FPM_PORT=9000 (new — was embedded in NGINX_FPM_SERVICE)
NGINX_PORT=8080 (unchanged)
NGINX_MAX_BODY_SIZE=140m (was 10m)
NGINX_SET_REAL_IP_FROM=172.16.0.0/12 (was 172.17.0.0/16)
The /16 → /12 widening covers the full RFC1918 docker bridge range
(172.16-172.31), so multi-network compose stacks no longer need to
override the default. The 140m upload cap matches the planned
PHP_POST_MAX_SIZE / NGINX_MAX_BODY_SIZE alignment for media uploads.
The production template's upstream block now references
${NGINX_FPM_SERVICE}:${NGINX_FPM_PORT} explicitly.
The dev compose stack uses its own template under .docker/templates/
and is unaffected by this change.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…r-mono-repo' into feature/5402-align-nginx-env-vars # Conflicts: # CHANGELOG.md
…r-mono-repo' into feature/5402-align-nginx-env-vars # Conflicts: # CHANGELOG.md # infrastructure/nginx/Dockerfile
After PR #409 unified the dev and prod nginx templates, the dev compose stack also consumes the production template — but it still passed NGINX_FPM_SERVICE as a combined 'host:port' string. With the template change in this PR ('server ${NGINX_FPM_SERVICE}:${NGINX_FPM_PORT};'), that produced a malformed 'display-phpfpm-1:9000:9000' upstream and nginx failed to start, breaking the Playwright CI run. Split the value in both docker-compose.yml and docker-compose.server.yml. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Future nginx config errors now block playwright instead of surfacing as DNS failures. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
tuj
approved these changes
Apr 29, 2026
turegjorup
merged commit Apr 29, 2026
f259227
into
feature/update-infrastructure-for-mono-repo
18 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Finalize the nginx image's operator-facing env-var surface — one name per concept, so the compose side never has to guess what to set.
NGINX_FPM_SERVICEos2display(host only)NGINX_FPM_PORTNGINX_FPM_SERVICE)9000NGINX_PORT80808080NGINX_MAX_BODY_SIZE10m140mNGINX_SET_REAL_IP_FROM172.17.0.0/16172.16.0.0/12Why these defaults
/16→/12forNGINX_SET_REAL_IP_FROM: covers the full RFC1918 docker bridge range (172.16.0.0–172.31.255.255) so multi-network compose stacks don't need to override.140mupload cap: aligns with the plannedPHP_POST_MAX_SIZEceiling for media uploads. Operators raising one and forgetting the other was a frequent footgun.NGINX_FPM_SERVICEandNGINX_FPM_PORT: the previous combinedhost:portvalue forced operators to embed the port in the hostname env var, which made it impossible to override one without the other and read awkwardly in compose.Local validation
Built the production nginx image from this branch and verified at runtime:
Out of scope
.docker/templates/and is unaffected. (Unifying dev and prod templates is a separate effort.)Test plan
docker run -e NGINX_MAX_BODY_SIZE=200m <image> cat /etc/nginx/conf.d/default.conf | grep client_max_body_sizeshows200m.server os2display:9000;.task compose-upand the dev nginx still serves correctly (separate template).🤖 Generated with Claude Code